package person.locke.regexandgame.game;

import person.locke.regexandgame.game.plant.*;
import person.locke.regexandgame.game.zombie.*;

/**
 * Created by Administrator on 2018/7/4.
 */
public class PlayGround {

    public static void main(String[] args){

        //init plants
        Plant plant1 = new Sunflower("sunflower",100,10);
        Plant plant2 = new PotatoesWall("potatoesWall",100,200);
        Plant plant3 = new Peasecod("peasecods",50,20);
        Plant plant4 = new Chomper("chomper",75,30);

        //init zombies
        Zombie zombie1 = new NormalZombie("normal",125,15);
        Zombie zombie2 = new RemoteAttackZombie("remoteAttackZombie",100,20);
        Zombie zombie3 = new FlyZombie("flyZombie",100,15);
        Zombie zombie4 = new DefenseZombie("defenseZombie",100,200);

        Sunflower sunflower = (Sunflower)plant1;
        sunflower.produce();

        NormalZombie normalZombie = (NormalZombie)zombie1;
        //normal attack sunflower
        normalZombie.attack(sunflower);

        FlyZombie flyZombie = (FlyZombie)zombie3;
        flyZombie.fly();
        flyZombie.attack(plant2);

        RemoteAttackZombie remoteAttackZombie =(RemoteAttackZombie)zombie2;
        remoteAttackZombie.remoteAttack(plant3);

        DefenseZombie defenseZombie = (DefenseZombie)zombie4;
        defenseZombie.defence();

        PotatoesWall potatoesWall = (PotatoesWall)plant2;
        potatoesWall.defence();

        Chomper chomper =(Chomper)plant4;
        chomper.attack(normalZombie);

        Peasecod peasecod = (Peasecod)plant3;
        peasecod.remoteAttack(defenseZombie);


    }
}
